<?php get_header(); ?>

<div id="content">
<?php 
$ordernumber = get_post_meta($post->ID, 'product_order_number', true);
$is_natural_stone = get_post_meta($post->ID, 'is_natural_stone', true);



//if(in_array($post -> post_name, $load_stone_detail_view)):

if($is_natural_stone):
    //echo 'yes here';
	get_template_part('template-naturalstone'); 
elseif($ordernumber):
    //echo 'yes here';
	get_template_part('productpage'); 
	//get_template_part('template', 'magazine');
else:
/*
** checking if it is company page
*/
$post_categories = wp_get_post_categories( $post -> ID );

//print_r($post_categories);

$cats = array();
	
foreach($post_categories as $c){
	$cat = get_category( $c );
	if($cat->name == 'Companies')
		$it_is_company = true;
}

	if($it_is_company)
	{
		if(in_category('Profile 1', $post -> ID))
			get_template_part('company-profile-1');
		elseif(in_category('Profile 2', $post -> ID))
			get_template_part('company-profile-2');
		elseif(in_category('Profile 3', $post -> ID))
			get_template_part('company-profile-3');
		elseif(in_category('Pending', $post -> ID) or in_category('Data Entry', $post -> ID))
			get_template_part('company-pending');
	}
endif;
?>

</div><!-- #content -->

<?php get_sidebar(); ?>

<?php get_footer(); ?>
